//
// Created by Dell on 2021/12/11.
//

//#include <stdio.h>
#include <math.h>
#include <iostream>
#include <vector>
#include <math.h>
#include <stack>
#include <algorithm>
#include <string.h>

using namespace std;
string work(int x){
    string s = "";
    while(x){
        if(x%2 == 1) s += '1';
        else {
            s += '0';
        }
        x /= 2;
    }
    while (s.size() < 4) {
        s += '0';
    }
    reverse(s.begin(),s.end());
    return s;
}

int n,m;
int ans = 0;

int main()
{
    cin>>n;

    for(int i = 0;i<n;++i){
       int tem;
       cin>>tem;
       string ss = work(tem);
       if(ss[0] == '1' || ss[1] == '1'){
           ++ans;
       }
    }
    cout<<ans;

    return 0;
}

